<?php $total_rec = count($rs);?>
<?php foreach($rs as $row){ $start_number++?>        
<tr class="<?php echo $row->verifikasi=='Ya'?'sudah-verifikasi ':'belum-verifikasi ';?>tr-aktifitas-pegawai pid-<?php echo $row->nip ?> tid-<?php echo $row->id_aktifitas?>" statusVerifikasi="<?php echo $row->verifikasi;?>" >

<td <?php echo  ($start_number != $total_rec) ? ' class="no-border" ' : ''; ?><?php echo '';?>></td>
<td  <?php echo  ($start_number != $total_rec) ? ' class="no-border" ' : ''; ?>><?php echo $row->verifikasi=='Ya'?'<i title="Sudah Diverifikasi" style="float: right; margin: 6px;" class="fa fa-flag" ></i>':'<i style="float: right; margin: 6px;" title="Belum Diverifikasi" class="fa fa-exclamation-circle"></i>';?></td>
<td><div><?php echo date('d/m/Y',strtotime($row->tgl_kegiatan));?></div></td>
<td><div title="<?php echo $row->uraian_kegiatan?>"><?php echo substr($row->uraian_kegiatan,0,50).(strlen($row->uraian_kegiatan) <= 50 ? '':'...');?></div></td>
<td><div title="<?php echo $row->hasil?>"><?php echo substr($row->hasil,0,50).(strlen($row->hasil) <= 50 ? '':'...'); ?></div></td>

<td>
				<div class='tools action-aktifitas-pegawai-r' style=" width: 64px; margin: 0px auto;">				
					<?php $ci =& get_instance()?>
					<?php if($ci->LoginInfo->is('Lurah')):?>
                   <a href='<?php echo site_url('master/aktifitas_pegawai/delete/'.$row->id_aktifitas);?>' title='<?php echo 'Hapus Aktifitas'?> <?php echo $subject?>' class="delete-row" >
                    			<span class='delete-icon  ui-corner-all ui-icon ui-icon-trash'></span>
                   </a>
                   
					<a onclick="query_form(this)" href='<?php echo site_url('master/aktifitas_pegawai/edit/'.$row->id_aktifitas);?>' title='<?php echo 'Edit Aktifitas'?> <?php echo $subject?>' class="edit_button"><span class='edit-icon ui-corner-all ui-icon ui-icon-pencil'></span></a>
					
					<?php endif;?>
					<a onclick="query_form(this)" href='<?php echo site_url('master/aktifitas_pegawai/read/'.$row->id_aktifitas);?>' title='<?php echo 'Detail Aktifitas'?> <?php echo $subject?>' class="edit_button"><span class='read-icon  ui-corner-all ui-icon ui-icon-document'></span></a>
					<?php if($ci->LoginInfo->is('Lurah')):?>
					<a <?php echo !($row->verifikasi!='Ya')?' style="visibility:hidden" ':'';?> onclick="query_form(this)" href='<?php echo site_url('master/aktifitas_pegawai/ubah_verifikasi/'.$row->id_aktifitas);?>' title='<?php echo 'Verifikasi Aktifitas ?'?> <?php echo $subject?>' class="read_button ubah_aktifitas"><span class='edit-icon ui-corner-all ui-icon ui-icon-check'></span></a>
					<?php endif;?>
					<div class="clear"></div>
				</div>
</td>
</tr>			
<?php } ?>		
<script type="text/javascript">
try{
	add_edit_button_listener();

	$('a.read_button.ubah_aktifitas').unbind('click').click(function (argument) {
		$.post(this.href,function(r){
			console.log(r)
			$('tr.tid-'+r+'').find('a.ubah_aktifitas').css('visibility','hidden');
			error_alert('Info','Verifikasi Aktifitas Berhasil.');
			refresh_grid();
		})	
		return false;
	});
	
}catch(e){}
</script>